import {GameFrameworkEventArgs} from "../Base/GameFrameworkEventArgs";
import {PlaySoundParams} from "./PlaySoundParams";
import {ReferencePool} from "../Base/ReferencePool/ReferencePool";

export class PlaySoundUpdateEventArgs extends GameFrameworkEventArgs{
    get serialId(): number {
        return this._serialId;
    }

    get soundAssetName(): string {
        return this._soundAssetName;
    }

    get soundGroupName(): string {
        return this._soundGroupName;
    }

    get playSoundParams(): PlaySoundParams {
        return this._playSoundParams;
    }

    get progress(): number {
        return this._progress;
    }

    get userData() {
        return this._userData;
    }
    private _serialId:number;
    private _soundAssetName:string;
    private _soundGroupName:string;
    private _playSoundParams:PlaySoundParams;
    private _progress:number;
    private _userData;
    constructor() {
        super();
        this._serialId = 0;
        this._soundAssetName = null;
        this._soundGroupName = null;
        this._playSoundParams = null;
        this._progress = 0;
        this._userData = null;
    }

    public static Create(serialId:number,soundAssetName:string,soundGroupName:string,playSoundParams:PlaySoundParams,progress:number,userData):PlaySoundUpdateEventArgs{
        let playSoundUpdateEventArgs:PlaySoundUpdateEventArgs = ReferencePool.Acquire(PlaySoundUpdateEventArgs);
        playSoundUpdateEventArgs._serialId = serialId;
        playSoundUpdateEventArgs._soundAssetName = soundAssetName;
        playSoundUpdateEventArgs._soundGroupName = soundGroupName;
        playSoundUpdateEventArgs._playSoundParams = playSoundParams;
        playSoundUpdateEventArgs._progress = progress;
        playSoundUpdateEventArgs._userData = userData;
        return playSoundUpdateEventArgs;
    }


    Clear(): void {
        this._serialId = 0;
        this._soundAssetName = null;
        this._soundGroupName = null;
        this._playSoundParams = null;
        this._progress = 0;
        this._userData = null;
    }

}